﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AppEnvironment.Lib
{
    public class AppBeforeNewForTypeArgs<T> : EventArgs
    {
        internal bool InstanceToUseChanged = false;
        private T mInstanceToUse;
        /// <summary>
        /// Null by default. Set this to an instance of T - to override the instance that will be used by calling code.
        /// </summary>
        public T InstanceToUse
        {
            get
            {
                return mInstanceToUse;
            }
            set
            {
                mInstanceToUse = value;
                InstanceToUseChanged = true;
            }
        }

        /// <summary>
        /// Type that will be created. May differ from typeof(T) if overridden
        /// </summary>
        public Type TypeToCreate { get; internal set; }
    }
}
